test output from setTarget.py<br>
<script>
var callback1= 
function () {
 var templateArray = [
"( \n"
,"function () {\n"
," var templateArray = [\n"
,"\"\\n\"\n"
,",\"{${include \\\"whiff_middleware\\\/callPageWithStrings\\\"}$}\\n\"\n"
,",\"{${using page}$}\\n\"\n"
,",\"\\\/\\\/ Generate HTML and javascript at server to execute here\\n\"\n"
,",\"\\\/\\\/ first load template to the element innerHTML\\n\"\n"
,",\"        {${include \\\"whiff_middleware\\\/setInnerHtml\\\"}$}\\n\"\n"
,",\"            {${using elementName}$}exampleId{${\\\/using}$}\\n\"\n"
,",\"            {${using page}$}NEW INNER HTML1{${\\\/using}$}\\n\"\n"
,",\"        {${\\\/include}$}\\n\"\n"
,",\"        ; \\\/\\\/ end of code to load HTML\\n\"\n"
,",\"\\\/\\\/ then execute the javascript\\n\"\n"
,",\"        \\\/\\\/ create an anonymous function and call it\\n\"\n"
,",\"var lastSetTargetAction = function () {\\n\"\n"
,",\"   \\\/\\\/ get the target\\n\"\n"
,",\"   var target = document.getElementById(\\\"exampleId\\\");\\n\"\n"
,",\"   target.onclick = \\n\"\n"
,",\"function () {\\n\"\n"
,",\" var templateArray = [\\n\"\n"
,",\"\\\"\\\\n\\\"\\n\"\n"
,",\",\\\"{$${include \\\\\\\"whiff_middleware\\\\\\\/callPageWithStrings\\\\\\\"}$$}\\\\n\\\"\\n\"\n"
,",\",\\\"{$${using page}$$}alert('onclick via server callback1'){$${\\\\\\\/using}$$"
,"}\\\\n\\\"\\n\"\n"
,",\",\\\"\\\\n\\\"\\n\"\n"
,",\",\\\"{$${\\\\\\\/include}$$}\\\\n\\\"\\n\"\n"
,",\",\\\"\\\"\\n\"\n"
,",\"];\\n\"\n"
,",\" var url = \\\"http:\\\\\\\/\\\\\\\/localhost:8888\\\\\\\/whiff_middleware\\\\\\\/expandPostedTe"
,"mplate\\\";\\n\"\n"
,",\" var prefix = \\\"\\\";\\n\"\n"
,",\" var asynchronous = false;\\n\"\n"
,",\" var relativeUrl = null;\\n\"\n"
,",\" jswhiff_exec_template(url, templateArray, prefix, asynchronous, relativeUrl);"
,"\\n\"\n"
,",\"}\\n\"\n"
,",\" ;\\n\"\n"
,",\"alert('misc javascript1')\\n\"\n"
,",\";\\n\"\n"
,",\" };\\n\"\n"
,",\"\\\/\\\/ call the function now\\n\"\n"
,",\"lastSetTargetAction();\\n\"\n"
,",\"{${\\\/using}$}\\n\"\n"
,",\"\\n\"\n"
,",\"{${\\\/include}$}\\n\"\n"
,",\"\"\n"
,"];\n"
," var url = \"http:\\\/\\\/localhost:8888\\\/whiff_middleware\\\/expandPostedTemplate\";\n"
," var prefix = \"\";\n"
," var asynchronous = false;\n"
," var relativeUrl = null;\n"
," jswhiff_exec_template(url, templateArray, prefix, asynchronous, relativeUrl);\n"
,"}\n"
," ) ();"
];
 var url = "http:\/\/localhost:8888\/whiff_middleware\/expandPostedTemplate";
 var prefix = "";
 var asynchronous = false;
 var relativeUrl = null;
 jswhiff_exec_template(url, templateArray, prefix, asynchronous, relativeUrl);
}
;
var callback2= 
function () {
 var templateArray = [
"\n"
,"{{include \"whiff_middleware\/callPageWithStrings\"}}\n"
,"{{using page}}\/\/ create an anonymous function and call it\n"
,"var lastSetTargetAction = function () {\n"
,"   \/\/ get the target\n"
,"   var target = document.getElementById(\"exampleId\");\n"
,"   target.onclick = \n"
,"function () {\n"
," var templateArray = [\n"
,"\"\\n\"\n"
,",\"{${include \\\"whiff_middleware\\\/callPageWithStrings\\\"}$}\\n\"\n"
,",\"{${using page}$}alert('onclick2 via server callback'){${\\\/using}$}\\n\"\n"
,",\"{${using dummy2}$}dummy2{${\\\/using}$}\\n\"\n"
,",\"{${\\\/include}$}\\n\"\n"
,",\"\"\n"
,"];\n"
," var url = \"http:\\\/\\\/localhost:8888\\\/whiff_middleware\\\/expandPostedTemplate\";\n"
," var prefix = \"\";\n"
," var asynchronous = false;\n"
," var relativeUrl = null;\n"
," jswhiff_exec_template(url, templateArray, prefix, asynchronous, relativeUrl);\n"
,"}\n"
," ;\n"
,"alert('only javascript2')\n"
,";\n"
," };\n"
,"\/\/ call the function now\n"
,"lastSetTargetAction();{{\/using}}\n"
,"{{using dummy2}}dummy2{{\/using}}\n"
,"{{\/include}}\n"
,""
];
 var url = "http:\/\/localhost:8888\/whiff_middleware\/expandPostedTemplate";
 var prefix = "";
 var asynchronous = false;
 var relativeUrl = null;
 jswhiff_exec_template(url, templateArray, prefix, asynchronous, relativeUrl);
}
;
</script>

    <script src="whiff_middleware/whiff.js"></script>
    <h1>set callback test</h1>

    <table border>
    <tr>
    <td>click:</td>
    <td bgcolor="pink" id="exampleId" onclick="alert('old onclick')">
    ORIGINAL TEXT</td>
    </tr>
    </table>
    <hr>
    <input type="button" value="1: change text, get alert, change onclick"
           onclick="callback1()">
    <input type="button" value="2: same text, get alert, change onclick"
           onclick="callback2()">
    <hr><hr>

